/*    */ package com.feeyin.radar.sys.service.impl;
/*    */ 
/*    */ import com.feeyin.radar.commons.Page;
/*    */ import com.feeyin.radar.sys.dao.ModelLogDAO;
/*    */ import com.feeyin.radar.sys.dao.UserDAO;
/*    */ import com.feeyin.radar.sys.model.ModelLog;
/*    */ import com.feeyin.radar.sys.model.Users;
/*    */ import com.feeyin.radar.sys.service.ModelLogService;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ 
/*    */ public class ModelLogServiceImpl
/*    */   implements ModelLogService
/*    */ {
/*    */   private ModelLogDAO modelLogDAO;
/*    */   private UserDAO userDAO;
/*    */ 
/*    */   public ModelLogDAO getModelLogDAO()
/*    */   {
/* 25 */     return this.modelLogDAO;
/*    */   }
/*    */ 
/*    */   public void setModelLogDAO(ModelLogDAO modelLogDAO) {
/* 29 */     this.modelLogDAO = modelLogDAO;
/*    */   }
/*    */ 
/*    */   public UserDAO getUserDAO() {
/* 33 */     return this.userDAO;
/*    */   }
/*    */ 
/*    */   public void setUserDAO(UserDAO userDAO) {
/* 37 */     this.userDAO = userDAO;
/*    */   }
/*    */ 
/*    */   public List getPageModelLogs(Page page) {
/* 41 */     List modelLogs = new ArrayList();
/* 42 */     modelLogs = this.modelLogDAO.getPageModelLogs(page);
/* 43 */     if (modelLogs == null) return null;
/* 44 */     for (int i = 0; i < modelLogs.size(); i++) {
/* 45 */       ModelLog modelLog = new ModelLog();
/* 46 */       modelLog = (ModelLog)modelLogs.get(i);
/* 47 */       Users user = new Users();
/* 48 */       user = this.userDAO.getUser(modelLog.getUserId());
/* 49 */       if (user != null) {
/* 50 */         modelLog.setUserName(user.getUserName());
/*    */       }
/*    */     }
/* 53 */     return modelLogs;
/*    */   }
/*    */ 
/*    */   public Integer getPageModelLogsCount() {
/* 57 */     return this.modelLogDAO.getPageModelLogsCount();
/*    */   }
/*    */ 
/*    */   public List getPageQueryModelLogs(ModelLog modelLog, Page page) {
/* 61 */     if (modelLog == null) return null;
/* 62 */     if (page == null) return null;
/*    */ 
/* 64 */     List modelLogs = new ArrayList();
/* 65 */     modelLogs = this.modelLogDAO.getPageModelLogsByDynamic(modelLog, page);
/* 66 */     if (modelLogs == null) return null;
/*    */ 
/* 68 */     for (int i = 0; i < modelLogs.size(); i++) {
/* 69 */       modelLog = new ModelLog();
/* 70 */       modelLog = (ModelLog)modelLogs.get(i);
/* 71 */       Users user = new Users();
/* 72 */       user = this.userDAO.getUser(modelLog.getUserId());
/* 73 */       if (user != null) {
/* 74 */         modelLog.setUserName(user.getUserName());
/*    */       }
/*    */     }
/* 77 */     return modelLogs;
/*    */   }
/*    */ 
/*    */   public Integer getPageQueryModelLogsCount(ModelLog modelLog) {
/* 81 */     if (modelLog == null) return Integer.valueOf(0);
/* 82 */     return this.modelLogDAO.getPageModelLogsCountByDynamic(modelLog);
/*    */   }
/*    */ 
/*    */   public boolean insertModelLog(ModelLog modelLog) {
/* 86 */     return this.modelLogDAO.insertModelLog(modelLog);
/*    */   }
/*    */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.service.impl.ModelLogServiceImpl
 * JD-Core Version:    0.6.0
 */